<!DOCTYPE html>

<html lang="en">
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>教程 2：INVO 项目讲解（Tutorial 2: Explaining INVO） &mdash; Phalcon 2.0.0 文档</title>
    <meta name="keywords" content="php, phalcon, phalcon php, php framework, faster php framework"><link rel="stylesheet" type="text/css" href="../_static/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://static.phalconphp.com/css/phalcon.min.css" />
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400' rel='stylesheet' type='text/css'>
    <link href="http://fonts.googleapis.com/css?family=Merriweather:400,700" rel="stylesheet" type="text/css" />
    <!--
    EUROPE <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=latin-ext' rel='stylesheet' type='text/css'>
    GREEK <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=greek-ext' rel='stylesheet' type='text/css'>
    RUSSIA <link href='https://fonts.googleapis.com/css?family=Open+Sans:700,400&subset=cyrillic-ext,latin' rel='stylesheet' type='text/css'>
    -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/docs.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>

    <script src="../_static/jquery.min.js"></script>
    <script type="text/javascript" src="../_static/docs.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Phalcon 2.0.0 文档" href="../index.html" />
    <link rel="next" title="Tutorial 3: Securing INVO" href="tutorial-invo-2.html" />
    <link rel="prev" title="教程 1：让我们通过例子来学习（Tutorial 1: Let’s learn by example）" href="tutorial.html" /> 
  </head>
  <body>

<header class="page-header">
    <nav class="navbar" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-container">
                    <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
                </button>
                <a class="navbar-brand phalcon-logo" href="/"><span itemprop="name" class="sr-only">Phalcon PHP</span></a>
            </div>

            <div class="collapse navbar-collapse navbar-right" id="main-menu-container">
                <ul class="nav navbar-nav main-menu">
                  <li class="first"><a href="http://phalconphp.com/en/download" class="header-nav-link">Download</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="http://blog.phalconphp.com/" class="header-nav-link" target="_blank">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                </ul>
            </div>
        </div>
    </nav>
  </header>

<div class="heading">
    <div class="container">
        <div class="row">
            <h2>Documentation</h2>
        </div>
    </div>
</div>
    <!--<div class="header-line">
      <div class="size-wrap">
        <div class="header-line-title title-white">Documentation</div>
      </div>
    </div>-->
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="tutorial-invo-2.html" title="Tutorial 3: Securing INVO"
             accesskey="N">下一页</a> |</li>
        <li class="right" >
          <a href="tutorial.html" title="教程 1：让我们通过例子来学习（Tutorial 1: Let’s learn by example）"
             accesskey="P">上一页</a> |</li>
        <li><a href="http://phalconphp.com">Home</a> &raquo;</li>
        <li><a href="../index.html">Phalcon 2.0.0 文档</a> &raquo;</li> 
      </ul>
    </div>  

      <table width="100%" align="center" cellpadding="0" cellspacing="0">
        <tr>
      <td class="primary-box" width="25%" valign="top">
            <div>
            <div id="searchbox" style="">
                <!--<form class="search" action="http://readthedocs.org/search/project/" method="get">
                  <input type="search" name="q" size="25" placeholder="Search">
                  <input type="submit" value="Go">
                  <input type="hidden" name="selected_facets" value="project:">
                </form>-->
                <div style="width:200px;padding:10px">
                  <gcse:searchbox-only></gcse:searchbox-only>
                </div>
            </div>
            </div>
            <div style="padding:5px;padding-left:10px">
              <div id="carbonads-container">
                <div class="carbonad"><div id="azcarbon"></div>
                <script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/56496/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script>
                </div></div>
            </div>
            <h3><a href="../index.html">內容目录</a></h3>
            <ul>
<li><a class="reference internal" href="#">教程 2：INVO 项目讲解（Tutorial 2: Explaining INVO）</a><ul>
<li><a class="reference internal" href="#project-structure">项目结构（Project Structure）</a></li>
<li><a class="reference internal" href="#routing">路由（Routing）</a></li>
<li><a class="reference internal" href="#configuration">配置（Configuration）</a></li>
<li><a class="reference internal" href="#autoloaders">自动加载（Autoloaders）</a></li>
<li><a class="reference internal" href="#registering-services">Registering services</a></li>
<li><a class="reference internal" href="#handling-the-request">Handling the Request</a></li>
<li><a class="reference internal" href="#dependency-injection">依赖注入（Dependency Injection）</a></li>
</ul>
</li>
</ul>

            <h4>上一个主题</h4>
            <p class="topless"><a href="tutorial.html" title="上一章">&lt; 教程 1：让我们通过例子来学习（Tutorial 1: Let&#8217;s learn by example）</a></p>
            <h4>下一个主题</h4>
            <p class="topless"><a href="tutorial-invo-2.html" title="下一章">Tutorial 3: Securing INVO &gt;</a></p>
            <h3>本页</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/tutorial-invo.txt" rel="nofollow">显示源代码</a></li>
            </ul>
        </td>
          <td class="second-box" valign="top">
            <div class="document">
                <div class="documentwrapper">
                  <div class="bodywrapper">
                    <div class="body" >
                      
  <div class="section" id="invo-tutorial-2-explaining-invo">
<h1>教程 2：INVO 项目讲解（Tutorial 2: Explaining INVO）<a class="headerlink" href="#invo-tutorial-2-explaining-invo" title="永久链接至标题">¶</a></h1>
<p>In this second tutorial, we&#8217;ll explain a more complete application in order to deepen the development with Phalcon.
INVO is one of the applications we have created as samples. INVO is a small website that allows their users to
generate invoices, and do other tasks such as manage their customers and products. You can clone its code from <a class="reference external" href="https://github.com/phalcon/invo">Github</a>.</p>
<p>Also, INVO was made with <a class="reference external" href="http://getbootstrap.com/">Bootstrap</a> as client-side framework. Although the application does not generate
invoices, it still serves as an example to understand how the framework works.</p>
<div class="section" id="project-structure">
<h2>项目结构（Project Structure）<a class="headerlink" href="#project-structure" title="永久链接至标题">¶</a></h2>
<p>Once you clone the project in your document root you&#8217;ll see the following structure:</p>
<div class="highlight-bash"><div class="highlight"><pre>invo/
    app/
        config/
        controllers/
        library/
        forms/
        models/
        plugins/
        views/
    public/
        bootstrap/
        css/
        js/
    schemas/
</pre></div>
</div>
<p>As you know, Phalcon does not impose a particular file structure for application development. This project
provides a simple MVC structure and a public document root.</p>
<p>Once you open the application in your browser <a class="reference external" href="http://localhost/invo">http://localhost/invo</a> you&#8217;ll see something like this:</p>
<div class="figure align-center">
<img alt="../_images/invo-1.png" src="../_images/invo-1.png" />
</div>
<p>The application is divided into two parts, a frontend, that is a public part where visitors can receive information
about INVO and request contact information. The second part is the backend, an administrative area where a
registered user can manage his/her products and customers.</p>
</div>
<div class="section" id="routing">
<h2>路由（Routing）<a class="headerlink" href="#routing" title="永久链接至标题">¶</a></h2>
<p>INVO uses the standard route that is built-in with the Router component. These routes match the following
pattern: /:controller/:action/:params. This means that the first part of a URI is the controller, the second the
action and the rest are the parameters.</p>
<p>The following route /session/register executes the controller SessionController and its action registerAction.</p>
</div>
<div class="section" id="configuration">
<h2>配置（Configuration）<a class="headerlink" href="#configuration" title="永久链接至标题">¶</a></h2>
<p>INVO has a configuration file that sets general parameters in the application. This file is read in the first few lines
of the bootstrap file (public/index.php):</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Config\Adapter\Ini</span> <span class="k">as</span> <span class="nx">ConfigIni</span><span class="p">;</span>

<span class="c1">// ...</span>

<span class="sd">/**</span>
<span class="sd"> * Read the configuration</span>
<span class="sd"> */</span>
<span class="nv">$config</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ConfigIni</span><span class="p">(</span><span class="nx">APP_PATH</span> <span class="o">.</span> <span class="s1">&#39;app/config/config.ini&#39;</span><span class="p">);</span>
</pre></div>
</div>
<p><a class="reference internal" href="config.html"><em>Phalcon\Config</em></a> allows us to manipulate the file in an object-oriented way. The configuration file
contains the following settings:</p>
<div class="highlight-ini"><div class="highlight"><pre><span class="k">[database]</span>
<span class="na">adapter</span>  <span class="o">=</span> <span class="s">Mysql</span>
<span class="na">host</span>     <span class="o">=</span> <span class="s">localhost</span>
<span class="na">username</span> <span class="o">=</span> <span class="s">root</span>
<span class="na">password</span> <span class="o">=</span>
<span class="na">name</span>     <span class="o">=</span> <span class="s">invo</span>

<span class="k">[application]</span>
<span class="na">controllersDir</span> <span class="o">=</span> <span class="s">app/controllers/</span>
<span class="na">modelsDir</span>      <span class="o">=</span> <span class="s">app/models/</span>
<span class="na">viewsDir</span>       <span class="o">=</span> <span class="s">app/views/</span>
<span class="na">pluginsDir</span>     <span class="o">=</span> <span class="s">app/plugins/</span>
<span class="na">formsDir</span>       <span class="o">=</span> <span class="s">app/forms/</span>
<span class="na">libraryDir</span>     <span class="o">=</span> <span class="s">app/library/</span>
<span class="na">baseUri</span>        <span class="o">=</span> <span class="s">/invo/</span>
</pre></div>
</div>
<p>Phalcon hasn&#8217;t any pre-defined convention settings. Sections help us to organize the options as appropriate.
In this file there are two sections to be used later &#8220;application&#8221; and &#8220;database&#8221;.</p>
</div>
<div class="section" id="autoloaders">
<h2>自动加载（Autoloaders）<a class="headerlink" href="#autoloaders" title="永久链接至标题">¶</a></h2>
<p>The second part that appears in the bootstrap file (public/index.php) is the autoloader:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="sd">/**</span>
<span class="sd"> * Auto-loader configuration</span>
<span class="sd"> */</span>
<span class="k">require</span> <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="s1">&#39;app/config/loader.php&#39;</span><span class="p">;</span>
</pre></div>
</div>
<p>The autoloader registers a set of directories in which the application will look for
the classes that it eventually will need.</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="nv">$loader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\Phalcon\Loader</span><span class="p">();</span>

<span class="sd">/**</span>
<span class="sd"> * We&#39;re a registering a set of directories taken from the configuration file</span>
<span class="sd"> */</span>
<span class="nv">$loader</span><span class="o">-&gt;</span><span class="na">registerDirs</span><span class="p">(</span>
    <span class="k">array</span><span class="p">(</span>
        <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="nv">$config</span><span class="o">-&gt;</span><span class="na">application</span><span class="o">-&gt;</span><span class="na">controllersDir</span><span class="p">,</span>
        <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="nv">$config</span><span class="o">-&gt;</span><span class="na">application</span><span class="o">-&gt;</span><span class="na">pluginsDir</span><span class="p">,</span>
        <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="nv">$config</span><span class="o">-&gt;</span><span class="na">application</span><span class="o">-&gt;</span><span class="na">libraryDir</span><span class="p">,</span>
        <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="nv">$config</span><span class="o">-&gt;</span><span class="na">application</span><span class="o">-&gt;</span><span class="na">modelsDir</span><span class="p">,</span>
        <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="nv">$config</span><span class="o">-&gt;</span><span class="na">application</span><span class="o">-&gt;</span><span class="na">formsDir</span><span class="p">,</span>
    <span class="p">)</span>
<span class="p">)</span><span class="o">-&gt;</span><span class="na">register</span><span class="p">();</span>
</pre></div>
</div>
<p>Note that the above code has registered the directories that were defined in the configuration file. The only
directory that is not registered is the viewsDir, because it contains HTML + PHP files but no classes.
Also, note that we have using a constant called APP_PATH, this constant is defined in the bootstrap
(public/index.php) to allow us have a reference to the root of our project:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="c1">// ...</span>

<span class="nb">define</span><span class="p">(</span><span class="s1">&#39;APP_PATH&#39;</span><span class="p">,</span> <span class="nb">realpath</span><span class="p">(</span><span class="s1">&#39;..&#39;</span><span class="p">)</span> <span class="o">.</span> <span class="s1">&#39;/&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="registering-services">
<h2>Registering services<a class="headerlink" href="#registering-services" title="永久链接至标题">¶</a></h2>
<p>Another file that is required in the bootstrap is (app/config/services.php). This file allow
us to organize the services that INVO does use.</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="sd">/**</span>
<span class="sd"> * Load application services</span>
<span class="sd"> */</span>
<span class="k">require</span> <span class="nx">APP_PATH</span> <span class="o">.</span> <span class="s1">&#39;app/config/services.php&#39;</span><span class="p">;</span>
</pre></div>
</div>
<p>Service registration is achieved as in the previous tutorial, making use of a closure to lazily loads
the required components:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Mvc\Url</span> <span class="k">as</span> <span class="nx">UrlProvider</span><span class="p">;</span>

<span class="c1">// ...</span>

<span class="sd">/**</span>
<span class="sd"> * The URL component is used to generate all kind of urls in the application</span>
<span class="sd"> */</span>
<span class="nv">$di</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;url&#39;</span><span class="p">,</span> <span class="k">function</span><span class="p">()</span> <span class="k">use</span> <span class="p">(</span><span class="nv">$config</span><span class="p">){</span>
    <span class="nv">$url</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">UrlProvider</span><span class="p">();</span>
    <span class="nv">$url</span><span class="o">-&gt;</span><span class="na">setBaseUri</span><span class="p">(</span><span class="nv">$config</span><span class="o">-&gt;</span><span class="na">application</span><span class="o">-&gt;</span><span class="na">baseUri</span><span class="p">);</span>
    <span class="k">return</span> <span class="nv">$url</span><span class="p">;</span>
<span class="p">});</span>
</pre></div>
</div>
<p>We will discuss this file in depth later</p>
</div>
<div class="section" id="handling-the-request">
<h2>Handling the Request<a class="headerlink" href="#handling-the-request" title="永久链接至标题">¶</a></h2>
<p>If we skip to the end of the file (public/index.php), the request is finally handled by Phalcon\Mvc\Application
which initializes and executes all that is necessary to make the application run:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Mvc\Application</span><span class="p">;</span>

<span class="c1">// ...</span>

<span class="nv">$app</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Application</span><span class="p">(</span><span class="nv">$di</span><span class="p">);</span>

<span class="k">echo</span> <span class="nv">$app</span><span class="o">-&gt;</span><span class="na">handle</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">getContent</span><span class="p">();</span>
</pre></div>
</div>
</div>
<div class="section" id="dependency-injection">
<h2>依赖注入（Dependency Injection）<a class="headerlink" href="#dependency-injection" title="永久链接至标题">¶</a></h2>
<p>Look at the first line of the code block above, the Application class constructor is receiving the variable
$di as an argument. What is the purpose of that variable? Phalcon is a highly decoupled framework,
so we need a component that acts as glue to make everything work together. That component is Phalcon\DI.
It is a service container that also performs dependency injection and service location,
instantiating all components as they are needed by the application.</p>
<p>There are many ways of registering services in the container. In INVO, most services have been registered using
anonymous functions/closures. Thanks to this, the objects are instantiated in a lazy way, reducing the resources needed
by the application.</p>
<p>For instance, in the following excerpt the session service is registered. The anonymous function will only be
called when the application requires access to the session data:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\Session\Adapter\Files</span> <span class="k">as</span> <span class="nx">Session</span><span class="p">;</span>

<span class="c1">// ...</span>

<span class="c1">// Start the session the first time a component requests the session service</span>
<span class="nv">$di</span><span class="o">-&gt;</span><span class="na">set</span><span class="p">(</span><span class="s1">&#39;session&#39;</span><span class="p">,</span> <span class="k">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="nv">$session</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Session</span><span class="p">();</span>
    <span class="nv">$session</span><span class="o">-&gt;</span><span class="na">start</span><span class="p">();</span>
    <span class="k">return</span> <span class="nv">$session</span><span class="p">;</span>
<span class="p">});</span>
</pre></div>
</div>
<p>Here, we have the freedom to change the adapter, perform additional initialization and much more. Note that the service
was registered using the name &#8220;session&#8221;. This is a convention that will allow the framework to identify the active
service in the services container.</p>
<p>A request can use many services and registering each service individually can be a cumbersome task. For that reason,
the framework provides a variant of Phalcon\DI called Phalcon\DI\FactoryDefault whose task is to register
all services providing a full-stack framework.</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>

<span class="k">use</span> <span class="nx">Phalcon\DI\FactoryDefault</span><span class="p">;</span>

<span class="c1">// ...</span>

<span class="c1">// The FactoryDefault Dependency Injector automatically registers the</span>
<span class="c1">// right services providing a full-stack framework</span>
<span class="nv">$di</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">FactoryDefault</span><span class="p">();</span>
</pre></div>
</div>
<p>It registers the majority of services with components provided by the framework as standard. If we need to override
the definition of some service we could just set it again as we did above with &#8220;session&#8221; or &#8220;url&#8221;.
This is the reason for the existence of the variable $di.</p>
<p>In next chapter, we will see how to authentication and authorization is implemented in INVO.</p>
</div>
</div>


                    </div>
                  </div>
                </div>
            </div>
          </td>
        </tr>
      </table>
    <div class="related">
      <ul>
        <li class="right" >
          <a href="../genindex.html" title="总目录"
             >索引</a></li>
        <li class="right" >
          <a href="tutorial-invo-2.html" title="Tutorial 3: Securing INVO"
             >下一页</a> |</li>
        <li class="right" >
          <a href="tutorial.html" title="教程 1：让我们通过例子来学习（Tutorial 1: Let’s learn by example）"
             >上一页</a> |</li> 
      </ul>
    </div>

      <div class="prefooter">
  <div class="container">
      <div class="row">
          <div class="col-sm-3 text-right">
              <span>Follow along:</span>
          </div>
          <div class="col-sm-6 text-center">
              <a href="https://twitter.com/phalconphp" alt="Twitter" class="btn-social btn-social-twitter"><i class="icon-twitter"></i></a>
              <a href="https://www.facebook.com/pages/Phalcon-Framework/134230726685897" alt="Facebook" class="btn-social btn-social-facebook"><i class="icon-facebook"></i></a>
              <a href="https://plus.google.com/102376109340560896457" alt="Google+" class="btn-social btn-social-googleplus"><i class="icon-googleplus"></i></a>
              <a href="https://github.com/phalcon/cphalcon" alt="Github" class="btn-social btn-social-github"><i class="icon-github"></i></a>
          </div>
          <div class="col-sm-3">
          </div>
      </div>
  </div>

</div>
<footer class="footer">
  <div class="container">
      <div class="row">
          <div class="col-xs-4 col-sm-3">
              <h4>Download</h4>
              <ul>
                  <li><a href="http://phalconphp.com/download">Installing Phalcon</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/index.html" class="header-nav-link" target="_blank">Documentation</a></li>
                  <li><a href="http://api.phalconphp.com">API</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html">Tutorial</a></li>
                  <li><a href="http://docs.phalconphp.com/en/latest/reference/tutorial.html#sample-applications">Sample Applications</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-3">
              <h4>Community</h4>
              <ul>
                  <li><a href="http://forum.phalconphp.com/" class="header-nav-link" target="_blank">Forum</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon">GitHub</a></li>
                  <li><a href="https://github.com/phalcon/cphalcon/issues">Issue Tracker</a></li>
                  <li><a href="http://stackoverflow.com/questions/tagged/phalcon">Stack Overflow</a></li>
                  <li><a href="http://phalconphp.com/en/testimonials">Testimonials</a></li>
                  <li><a href="http://builtwith.phalconphp.com/">Built with Phalcon</a></li>
                  <li><a href="http://store.phalconphp.com/">Store</a></li>
              </ul>
          </div>
          <div class="col-xs-4 col-sm-2">
              <h4>About</h4>
              <ul>
                  <li><a class="link-black" href="http://blog.phalconphp.com/">Blog</a></li>
                  <li><a href="http://phalconphp.com/en/about">About</a></li>
                  <li><a href="http://phalconphp.com/en/team">Team</a></li>
                  <li><a href="http://phalconphp.com/en/roadmap">Roadmap</a></li>
                  <li><a href="http://phalconphp.com/en/donate">Donate</a></li>
                  <li><a href="http://phalconphp.com/en/consulting">Consulting</a></li>
                  <li><a href="http://phalconphp.com/en/hosting">Hosting</a></li>
              </ul>
          </div>
          <div id="license-spaccer" class="visible-xs"></div>
          <div id="license-wrapper" class="col-xs-12 col-sm-4">
              <p class="license">

                  Found a typo or an error? Want to improve this document? The documentation sources are available on <a href="http://github.com/phalcon/docs">Github</a><br>
                  Need support or have questions? Check our <a href="http://forum.phalconphp.com">Forum</a><br>
                  <br>

                  Phalcon Framework is released under the <a href="https://github.com/phalcon/cphalcon/blob/master/docs/LICENSE.md">new BSD license</a>.<br>
                  Except where otherwise noted, content on this site is licensed under the
                    <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License.</a>

                <div class="design">
                  <span>Designed by:</span>

                  <a href="http://www.fog-city.net/" class="fogcity" target="_blank" title="Fog City Software"><span>Fog City Software</span></a>
              </div>
          </div>
      </div>
  </div>
</footer>

    </div>
    <script type="text/javascript">
    $(window).on("load", function(){
      var cx = '009733439235723428699:lh9ltjgvdz8';
      var gcse = document.createElement('script');
      gcse.type = 'text/javascript';
      gcse.async = true;
      gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(gcse, s);
    });
    </script>

  </body>
</html>